<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<!DOCTYPE HTML>
<html>
<head>
<title>个人信息修改</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	
	<link href="${pageContext.request.contextPath }/css/bootstrap.css" rel='stylesheet' type='text/css' />
	<script type='text/javascript' src="${pageContext.request.contextPath }/js/jquery-3.2.1.min。js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/bootstrapValidator.min.js"></script>
	
	<link href="${pageContext.request.contextPath }/css/base.css" rel="stylesheet">
	<link href="${pageContext.request.contextPath }/css/m.css" rel="stylesheet">
	<script src="${pageContext.request.contextPath }/js/comm.js"></script>


<style type="text/css">
		body {
		    border: medium none;
		    margin: 0;
		    padding: 0;
		    width: 100%;
		}
		
		.headerWrap {
		    width: 100%;
		    height: 127px;
		    background: url('${ctx}/img/logo.jpg') no-repeat;
		    background-position-y: 71%;
		    background-position-x: 56.5%;
		    min-width: 1290px;
		    display: block;
		}
		
		.header {
			text-align:center;
		}
		
		.mandatory {
			color:RED;
			text-align:left!important;
			font-weight:normal;
		}
	</style>

	<script type="text/javascript">
		// $(function(){}) 等价于 <body onload="function(){}"> 
		$(function() {
			// $("#registerForm") 等价于 document.getElementById("registerForm");
			$("#sPersonalForm").bootstrapValidator({
				message : '该值不合法',
				feedbackIcons : {
					valid : 'glyphicon glyphicon-ok',
					invalid : 'glyphicon glyphicon-remove',
					validating : 'glyphicon glyphicon-refresh'
				},
				fields : {
					nikename : {
						message : '姓名不合法',
						validators : {
							notEmpty : { //非空验证
								message : '姓名不能为空'
							},
							
						}
					},
					password: {
						message: '密码不合法',
						validators: {
							notEmpty : { //非空验证
								message : '密码不能为空'
							},
							stringLength : { // 长度验证
								min : 1,
								max : 20,
								message : '密码长度需为1-20'
							},
							regexp : { // 正则式验证
								regexp : /^[0-9a-zA-Z_]+$/,
								message : '密码只能为字母、数字、下划线'
							},
							different: {
		                        field: 'regname',
		                        message: '密码不能与学号相同'
		                    }
						}
					}, //密码验证结束
					 sPerConfirmPwd:{
						message: '两次密码不一致',
						validators:{
							notEmpty: {
								message : '请确认密码'
							},
							identical: {
		                        field: 'password',
		                        message: '两次密码不一致'
		                    }
						}
					}, 
					sPerEmail:{
						message: '邮箱地址不合法',
						validators:{
							notEmpty : {
								message : '邮箱不能为空'
							},
							emailAddress:{
								message:'邮箱地址格式有误'
							}
						}
					},
					sPerEmailVali:{
						message:'验证码不正确',
						validators:{
							notEmpty : {
								message : '请填写验证码'
							},
							/* remote:{ // 远程验证
								type: 'POST',
		                        url: '${basePath}/checkValidationCode.do',
								message:'验证码不正确'
							} */
						}
					}
				}

			});
				
			});
		
	</script>
	
</head>
<body>
<!-- header -->

<header id="header">
  <div class="navbox">
    <h2 id="mnavh"><span class="navicon"></span></h2>
    <div class="logo"><a href="http://www.yangqq.com">校园资料共享墙</a></div>
    <nav>
      <ul id="starlist">
        <li><a href="${pageContext.request.contextPath }/data/listPage">首页</a></li>
        <li><a href="${pageContext.request.contextPath }/data/listPage">资料浏览</a></li>
        <li><a href="${pageContext.request.contextPath }/data/listPage">文件下载</a></li>
        <li class="menu"><a href="list.html">资料分类</a>
          <ul class="sub">
            <li><a href="/8">工科资料</a></li>
            <li><a href="/8">医学资料</a></li>
            <li><a href="/7">文科资料</a></li>
          </ul>
          <span></span>
        </li>
        <!--我的博客 登陆之后可用
        	<li><a href="#">优秀人博客</a></li>
        -->
        <li class="menu"><a href="list.html">我的资料</a>
          <ul class="sub">
            <li><a href="${pageContext.request.contextPath }/addData/toAddBolgUI">发布资料</a></li>
            <li><a href="/7">管理资料</a></li>
            <li><a href="/8">我的收藏</a></li>
            <li><a href="/8">我的关注</a></li>
            <li><a href="${pageContext.request.contextPath }/userRevise/updateInformationUI">个人中心</a></li>
            <li><a href="${pageContext.request.contextPath }/userRevise/updateInformationUI.do">个人中心</a></li>
          </ul>
          <span></span>
        </li>
        <!--<li><a href="list.html">我的博客</a></li>-->
        <li><a href="${pageContext.request.contextPath }/user/loginUI.do">登陆/注册</a></li>
        <li><a href="${pageContext.request.contextPath }/user/toLogout.do">注销</a></li>
      </ul>
    </nav>
    <div class="searchico"></div>
  </div>
</header>

<!-- 个人页面 -->
<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
		<div class="container " style="margin-top: 20px">
			<!-- 学生个人信息表 -->
					<form id="sPersonalForm" class="form-horizontal" action="${pageContext.request.contextPath }/userRevise/toUpdateInformation.do"  method="post">
					   <div class="form-group">
					  	   <h4 style="text-align: center;" class="col-sm-11">${upadtemsg }</h4>
					   </div>
					  <%-- <div class="form-group">
					  	<h4 style="text-align: center;" class="col-sm-11">${perMsg }</h4>
					  </div> --%>
					  <!-- 学号不能修改 -->
					  <div class="form-group">
					    <label for="username" class="col-sm-2 control-label">账号</label>
					    <div class="col-sm-4">
					      <input type="text" id="username" name="username" value="${currentUser.username }" class="form-control" readonly="readonly">
					    </div>
					  </div>
					  <div class="form-group">
					    <label for="nikename" class="col-sm-2 control-label">昵称</label>
					    <div class="col-sm-4">
					      <input type="text" id="nikename" name="nikename" value="${currentUser.nikename }" class="form-control">
					    </div>
					  </div>
					  <div class="form-group">
					    <label for="password" class="col-sm-2 control-label">密码</label>
					    <div class="col-sm-4">
					      <input type="password" id="password" name="password" value="${currentUser.password }" class="form-control" placeholder="仅支持字母数字下划线">
					    </div>
					  </div>
					  <div class="form-group">
					    <label for="sPerConfirmPwd" class="col-sm-2 control-label">确认密码</label>
					    <div class="col-sm-4">
					      <input type="password" id="sPerConfirmPwd" name="sPerConfirmPwd" value="${currentUser.password }" class="form-control" placeholder="仅支持字母数字下划线">
					    </div>
					  </div>
					  <%--  <div class="form-group">
					    <label for="sex" class="col-sm-2 control-label">性别</label>
					    <div class="col-sm-4">
					      <input type="radio" name="status" value=1   <c:if test="${currentUser.status==1 }">  checked="checked" </c:if> id="sex"/>男
						  <input type="radio" name="status" value=0   <c:if test="${currentUser.status==0 }">  checked="checked" </c:if> id="sex"/>女
					    </div>
					  </div> --%>
					  <!-- 修改邮箱 -->
	  				  <div class="form-group">
					    <label for="temail" class="col-sm-2 control-label" >邮箱</label>
					    <div class="col-sm-3">
					      <input type="email" id="sPerEmail" name="sPerEmail"  value="暂时不填" class="form-control">
					    </div>
					    <div style="margin-left: -16px" class="col-sm-2">
					      <input type="button"  class="btn btn-primary" value="邮箱验证" >
					    </div>
					  </div>
					  <div class="form-group">
					    <label for="teValidate" class="col-sm-2 control-label">验证码</label>
					    <div class="col-sm-4">
					      <input type="text" id="sPerEmailVali" name="sPerEmailVali"  class="form-control">
					    </div>
					  </div>
					  <div class="col-sm-offset-2 col-sm-6">
					    <button type="submit" class="btn btn-primary" style="width:125px">修改</button>
					  </div>			 
					</form>
				</div>
			</div>
		</div>
</body>
</html>